Release 10.1A: OpenEdge Data Management:
DataServer for ORACLE
Retrieving results sets using proc-text-buffer
The
proc–text–buffertechnique offers one approach to access results returned from a data source. The following information is the partial syntax for theDEFINEBUFFERstatement that you use to create a buffer with the same characteristics of theproc–text–buffer:
For a complete description, see the “DEFINE BUFFER statement” reference entry in OpenEdge Development: Progress 4GL Reference .
Technique to use proc-text-buffer
Example 3–6 illustrates returning database results into the
proc–text-bufferand converting the results to theINTEGERdata type.
Example 3–6: Returning database results into the proc-text-buffer and converting the results to the INTEGER data typeThe DataServer passes the PL/SQL statement directly to the ORACLE data source. The Progress Compiler does not process it, so errors occur only at run time and not when you compile a procedure.
Assessing a result set obtained from the proc-text-buffer technique
The advantage of using the
proc–text–bufferis that you do not have to worry about what kind of data the procedure returns. The buffer accepts any type of data, in any order, and converts it to the character equivalent. Another benefit of theproc–text–bufferis that it can be used to hold the results from all of the SQL statements included in a stored procedure. However, a buffer that you create can hold the results of only one result set record form one result set at a time.However, a disadvantage in using the
proc-text-buffertechnique is that it is much more difficult to manipulate the data after you receive it as it requires parsing the data. To act on anything butCHARACTERdata, you must extract the data from the buffer and convert it to its original data type before you can use it.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |